home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / test / test_macpath.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2005-10-18  |  3KB  |  70 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. import macpath
  5. from test import test_support
  6. import unittest
  7.  
  8. class MacPathTestCase(unittest.TestCase):
  9.     
  10.     def test_abspath(self):
  11.         self.assert_(macpath.abspath('xx:yy') == 'xx:yy')
  12.  
  13.     
  14.     def test_isabs(self):
  15.         isabs = macpath.isabs
  16.         self.assert_(isabs('xx:yy'))
  17.         self.assert_(isabs('xx:yy:'))
  18.         self.assert_(isabs('xx:'))
  19.         self.failIf(isabs('foo'))
  20.         self.failIf(isabs(':foo'))
  21.         self.failIf(isabs(':foo:bar'))
  22.         self.failIf(isabs(':foo:bar:'))
  23.  
  24.     
  25.     def test_commonprefix(self):
  26.         commonprefix = macpath.commonprefix
  27.         self.assert_(commonprefix([
  28.             'home:swenson:spam',
  29.             'home:swen:spam']) == 'home:swen')
  30.         self.assert_(commonprefix([
  31.             ':home:swen:spam',
  32.             ':home:swen:eggs']) == ':home:swen:')
  33.         self.assert_(commonprefix([
  34.             ':home:swen:spam',
  35.             ':home:swen:spam']) == ':home:swen:spam')
  36.  
  37.     
  38.     def test_split(self):
  39.         split = macpath.split
  40.         self.assertEquals(split('foo:bar'), ('foo:', 'bar'))
  41.         self.assertEquals(split('conky:mountpoint:foo:bar'), ('conky:mountpoint:foo', 'bar'))
  42.         self.assertEquals(split(':'), ('', ''))
  43.         self.assertEquals(split(':conky:mountpoint:'), (':conky:mountpoint', ''))
  44.  
  45.     
  46.     def test_splitdrive(self):
  47.         splitdrive = macpath.splitdrive
  48.         self.assertEquals(splitdrive('foo:bar'), ('', 'foo:bar'))
  49.         self.assertEquals(splitdrive(':foo:bar'), ('', ':foo:bar'))
  50.  
  51.     
  52.     def test_splitext(self):
  53.         splitext = macpath.splitext
  54.         self.assertEquals(splitext(':foo.ext'), (':foo', '.ext'))
  55.         self.assertEquals(splitext('foo:foo.ext'), ('foo:foo', '.ext'))
  56.         self.assertEquals(splitext('.ext'), ('', '.ext'))
  57.         self.assertEquals(splitext('foo.ext:foo'), ('foo.ext:foo', ''))
  58.         self.assertEquals(splitext(':foo.ext:'), (':foo.ext:', ''))
  59.         self.assertEquals(splitext(''), ('', ''))
  60.         self.assertEquals(splitext('foo.bar.ext'), ('foo.bar', '.ext'))
  61.  
  62.  
  63.  
  64. def test_main():
  65.     test_support.run_unittest(MacPathTestCase)
  66.  
  67. if __name__ == '__main__':
  68.     test_main()
  69.  
  70.